<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>onerror</title>
  </head>
  <body>
    <script>
      //onerror 练习
      onerror = function(msg,url,l){
          console.log('msg:'+msg)
          console.log('url:'+url);
          console.log('l:'+l);
          return true
      }
      function dog(){
          pdlks
          console.log('hahhhahh')
      }
      dog()
    //   onerror = handleErr;
    //   var txt = "";
    //   function handleErr(msg, url, l) {
    //     txt = "该页面有一个错误\n\n";
    //     txt += "错误: " + msg + "\n";
    //     txt += "URL: " + url + "\n";
    //     txt += "行: " + l + "\n\n";
    //     txt += "点击确定继续。\n\n";
    //     alert(txt);
    //     return true;
    //   }
    //   function message() {
    //     adddlert("Welcome guest!");
    //   }
    //   message()
    </script>
  </body>
</html>
